package com.ruoyi.order.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.order.mapper.DishFlavorMapper;
import com.ruoyi.order.domain.DishFlavor;
import com.ruoyi.order.service.IDishFlavorService;

/**
 * 菜品口味关系Service业务层处理
 * 
 * @author ruoyi
 * @date 2022-08-19
 */
@Service
public class DishFlavorServiceImpl implements IDishFlavorService 
{
    @Autowired
    private DishFlavorMapper dishFlavorMapper;

    /**
     * 查询菜品口味关系
     * 
     * @param dishFlavorId 菜品口味关系主键
     * @return 菜品口味关系
     */
    @Override
    public DishFlavor selectDishFlavorByDishFlavorId(Long dishFlavorId)
    {
        return dishFlavorMapper.selectDishFlavorByDishFlavorId(dishFlavorId);
    }

    /**
     * 查询菜品口味关系列表
     * 
     * @param dishFlavor 菜品口味关系
     * @return 菜品口味关系
     */
    @Override
    public List<DishFlavor> selectDishFlavorList(DishFlavor dishFlavor)
    {
        return dishFlavorMapper.selectDishFlavorList(dishFlavor);
    }

    /**
     * 新增菜品口味关系
     * 
     * @param dishFlavor 菜品口味关系
     * @return 结果
     */
    @Override
    public int insertDishFlavor(DishFlavor dishFlavor)
    {
        dishFlavor.setCreateTime(DateUtils.getNowDate());
        return dishFlavorMapper.insertDishFlavor(dishFlavor);
    }

    /**
     * 修改菜品口味关系
     * 
     * @param dishFlavor 菜品口味关系
     * @return 结果
     */
    @Override
    public int updateDishFlavor(DishFlavor dishFlavor)
    {
        dishFlavor.setUpdateTime(DateUtils.getNowDate());
        return dishFlavorMapper.updateDishFlavor(dishFlavor);
    }

    /**
     * 批量删除菜品口味关系
     * 
     * @param dishFlavorIds 需要删除的菜品口味关系主键
     * @return 结果
     */
    @Override
    public int deleteDishFlavorByDishFlavorIds(Long[] dishFlavorIds)
    {
        return dishFlavorMapper.deleteDishFlavorByDishFlavorIds(dishFlavorIds);
    }

    /**
     * 删除菜品口味关系信息
     * 
     * @param dishFlavorId 菜品口味关系主键
     * @return 结果
     */
    @Override
    public int deleteDishFlavorByDishFlavorId(Long dishFlavorId)
    {
        return dishFlavorMapper.deleteDishFlavorByDishFlavorId(dishFlavorId);
    }
}
